<%--
    Document   : deleteStop
    Created on : Jul 28, 2009, 4:20:13 PM
    Author     : david
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" 
        import="com.google.appengine.api.users.UserService,
        com.google.appengine.api.users.UserServiceFactory,
        com.appspot.nnaplanner.DAL.*, com.appspot.nnaplanner.*"%>
<%
            if (request.getUserPrincipal() == null) {
                response.sendError(response.SC_UNAUTHORIZED);
            }

            if (UserServiceFactory.getUserService().isUserAdmin()) {      
                    DALConnection dc= new DALConnection();
                    dc.setID(request.getParameter("id"));
                    dc.delete();
                    out.print("{\"success\": \"true\"}");
                    //TODO update Graph

            } else {
                 response.sendError(response.SC_UNAUTHORIZED);
            }
%>